<?php defined('LMO') or die('Can\'t access !'); ?>
<h2 class="title">Monitoring</h2>
<form action="" method="POST">
<table border="0" width="100%">
    <?php 
    if(!empty($data)):
        foreach($data as $server):
        if(!empty($server['service'])):
    ?>
    <tr>
        <td>
            <div class="line-dot">
                <h3><?php echo $server['name']; ?> - <?php echo $server['ip']; ?></h3>
            </div>
        </td>
    </tr>
    <tr>
        <td>
            <table width="100%" class="service-status">
                <?php
                foreach($server['service'] as $key => $item):
                    $item['status'] = (isset($item['status']) && $item['status'] == true) ? 'up':'down';
                ?>
                <tr class="<?php echo $item['status']; ?>">
                    <td width="10%" class="status">[<?php echo strtoupper($item['status']); ?>]</td>
                    <td width="15%"><?php echo strtoupper($item['name']); ?></td>
                    <td width="25%"><?php echo strtoupper($item['ip']).':'.$item['port']; ?></td>
                    <td width="25%"><?php echo date(TIME_FORMAT, $item['since']); ?></td>
                    <td width="25%"><?php echo date(TIME_FORMAT, $item['time']); ?></td>
                </tr>
                <?php
                endforeach;
                ?>
            </table>
        </td>
    </tr>
    <?php
        endif;
        endforeach;
    endif;
    ?>
    <tr>
        <td>
            <div class="line-dot"></div>
        </td>
    </tr>
</table>
</form>
<div class="clear"></div>
<meta http-equiv="refresh" content="60" />